package com.meizi.experimentcode.dsl;

import lombok.Data;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Administration
 * @date 2022/3/10 - 11:17 - 星期四
 * @project lambda
 * @package com.meizi.experimentcode.dsl
 * @by 晨
 */
@Data
public class order {

    private String customer;

    private List<Trade> trades = new ArrayList<>();

    public void addTrade (Trade trade) {
        trades.add(trade);
    }

    public double getValue () {
        return trades.stream().mapToDouble(Trade::getValue).sum();
    }
}
